<?php
namespace app\tp\controller;

class Zshswt
{
    public function index()
    {
	 return '这是无需头部的助手函数 http://www.2018a.com/47.94.136.51/t5/public/note.php/tp/ZshsWt/index';
	}
	
	/*
	 *得到助手函数request 的方法
	 */
	public function index2()
	{
	 $request = request();
	echo "代码为\$request = request();<hr/> ";
	  dump($request);

	}
	

	/**
	 * 设置 session
	 */
	public function index3()
	{
		$request = request();
		session('linshi','临时验证');
		session('linshi2','临时2');
		session('linshi3','临时3');
		$res = session('linshi');
		$res2 = $request->session('linshi');
echo"
<pre>
public function index3()
	{
		\$request = request();
		session('linshi','临时验证');
		dump(\$request->session());
	dump(\$res);
	dump(\$res2);
</pre><hr/>
";

	dump($request->session());
	dump($res);
	dump($res2);

	}




	public function index4()
	{
		$request = request();
	    $res = session('linshi');
		$res2 = $request->session('linshi');
echo"
<pre>
public function index4()
	{
		\$request = request();
	    \$res = session('linshi');
		\$res2 = \$request->session('linshi');
		dump(\$request->session());
		dump(\$res);
		dump(\$res2);
</pre><hr/>
";
    dump($request->session());
	dump($res);
	dump($res2);

	}


	public function index5(){
		$res = input('get.id',100,'intval');
		echo"
		<pre>
		public function index5(){
			\$res = input('get.id',100,'intval');
			dump(\$res);
		}
		</pre><hr/>
		";
        dump($res);
	}

	public function index6(){
		$request = request();
		session('linshi',null); 
		echo"
		<pre>
		public function index6(){
			\$request = request();
			session('linshi',null); 
			dump(\$request->session());
		}
		</pre><hr/>
		
		";

        dump($request->session());
	}

	public function index7(){
		$request = request();
		session(null); 
		echo"
		<pre>
		public function index7(){
			\$request = request();
			session(null); 
			dump(\$request->session());
		}
		</pre>

		";
         dump($request->session());
	}

	
}
